package cn.edu.scau.cmi.wangmaoren.singleton;

import java.util.ArrayList;

public class Marshal
{

	private static ArrayList<Marshal> marshalList = new ArrayList<>();
	private String name;

	private Marshal(String name)
	{
		this.setName(name);
	}

	public static ArrayList<Marshal> addInstance(String name)
	{
		if (marshalList.size() < 10)
		{
			Marshal marshal = new Marshal(name);
			marshalList.add(marshal);
		}
		return marshalList;
	}

	// 判断元帅集人数是否已满10人
	public static boolean isFull()
	{
		if (marshalList.size() < 10)
			return false;
		else
			return true;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

}